﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/AdminMasterPage.master"
    AutoEventWireup="true" CodeFile="WRENTRYManager.aspx.cs" Inherits="Admin_Pages_WRENTRYManager" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script language="javascript" type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(
        function () {
            if (document.getElementById) {
                var progress = document.getElementById('progress');
                var blur = document.getElementById('blur');
                progress.style.width = '300px';
                progress.style.height = '30px';
                blur.style.height = document.documentElement.clientHeight;
                progress.style.top = document.documentElement.clientHeight / 3 - progress.style.height.replace('px', '') / 2 + 'px';
                progress.style.left = document.body.offsetWidth / 2 - progress.style.width.replace('px', '') / 2 + 'px';
            }
        }
    )
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1><asp:Label ID="lbEntry" runat="server" Text="<%$ Resources:AllSite,lbEntry_userResource1 %>"></asp:Label></h1>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">
</asp:ToolkitScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            
        
    <asp:Panel runat="server" ID="pnShow">
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,btnAddEntry_Resource1 %>" CssClass="vadd" ID="btnAdd" OnClick="btnAdd_Click" Visible="true"></asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,btnDeleteEntry_Resource1 %>" CssClass="vdelete" ID="btnDelete" OnClick="btnDelete_Click" Visible="true">Delete</asp:LinkButton>
                </li>
            </ul>
        </div>
        <asp:DataGrid runat="server" ID="grvWRENTRY" Width="100%" CssClass="TableView" AutoGenerateColumns="False"
            AllowPaging="True" PageSize="9" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Center"
            OnItemCommand="grvWRENTRY_ItemCommand" OnPageIndexChanged="grvWRENTRY_PageIndexChanged">
            <HeaderStyle CssClass="trHeader"></HeaderStyle>
            <ItemStyle CssClass="trOdd"></ItemStyle>
            <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle>
            <Columns>
                <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="tdCenter"></ItemStyle>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="ID" HeaderText="ID" Visible="False" />
                <asp:BoundColumn  DataField="EntryName" HeaderText="<%$ Resources:AllSite,grEntryname_userResource1 %>" ItemStyle-CssClass="Text" />
                <asp:BoundColumn DataField="CreateDate" HeaderText="<%$ Resources:AllSite,grCreateDateEnt_userResource1 %>" ItemStyle-CssClass="Time" />
                <asp:BoundColumn DataField="Price" HeaderText="<%$ Resources:AllSite,grPriceEntry_userResource1 %>" ItemStyle-CssClass="Function" />
                <asp:BoundColumn DataField="NameApprove" HeaderText="<%$ Resources:AllSite,grNameApproveEntry_userResource1 %>" ItemStyle-CssClass="Function" />
                <asp:BoundColumn DataField="NameToContact" HeaderText="<%$ Resources:AllSite,grNameToContactEntry_userResource1 %>" ItemStyle-CssClass="Function" />
                <asp:BoundColumn DataField="PhoneToContact" HeaderText="<%$ Resources:AllSite,grPhoneToContactEntry_userResource1 %>" ItemStyle-CssClass="Function" />
           
                <asp:BoundColumn DataField="Active" HeaderText="<%$ Resources:AllSite,grActiveEnt_userResource1 %>" ItemStyle-CssClass="Active" />
                <asp:TemplateColumn ItemStyle-CssClass="Option">
                    <HeaderTemplate>
                       <asp:Label ID="lbOptionEnt" runat="server" Text="<%$ Resources:AllSite,grOptionEnt_userResource1 %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="btnEdit" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID") %>'
                            CommandName="Edit" ImageUrl="~/Admin/Images/edit.png" ToolTip="<%$ Resources:AllSite,btnEditEnt_Resource1 %>" />
                       
                        <asp:ImageButton ID="btnDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID") %>'
                            CommandName="Delete" ImageUrl="~/Admin/Images/delete.png" OnClientClick="return confirm('Are you sure?')"
                            ToolTip="<%$ Resources:AllSite,btnDeleteEnt_Resource1 %>" Visible="False"/>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <PagerStyle HorizontalAlign="Center" CssClass="gridview" Height="30" Position="Bottom" NextPageText="Previous"
                PrevPageText="Next" Mode="NumericPages"></PagerStyle>
        </asp:DataGrid>
    </asp:Panel>
    <asp:Panel runat="server" ID="pnUpdate">
        <div class="TableUpdate">
        <!--IDUpdateBy va CreateDate-->
            <div class="mainquoc" style="visibility: hidden">
                <div class="quoclable">
                        <asp:Label ID="lbCreateDate" Text="<%$ Resources:AllSite,lbCreateDateEnt_userResource1 %>" runat="server" Visible="False"></asp:Label>
                        <asp:TextBox ID="txtCreateDate" runat="server" Visible="False"></asp:TextBox>
                    </div>
                    <div class="quocinput_detail">
                        <asp:Label ID="lbIDCreateBy" Text="<%$ Resources:AllSite,lbIDCreateByEnt_userResource1 %>" runat="server" Visible="False"></asp:Label>
                        <asp:TextBox ID="txtIDCreateBy" runat="server" Visible="False"></asp:TextBox>
                    </div><div class="quoclable">
                        <asp:Label ID="lbUpdateDate" Text="<%$ Resources:AllSite,lbUpdateDateEnt_userResource1 %>" runat="server" Visible="False"></asp:Label>
                        <asp:TextBox ID="txtUpdateDate" runat="server" Visible="False"></asp:TextBox>
                    </div>
                    <div class="quocinput_detail">
                        <asp:Label ID="lbIDUpdateBy" Text="<%$ Resources:AllSite,lbIDUpdateByEnt_userResource1 %>" runat="server" Visible="False"></asp:Label>
                        <asp:TextBox ID="txtIDUpdateBy" runat="server" Visible="False"></asp:TextBox>                   
                    <asp:Label ID="lbID" runat="server" Visible="False" Text="ID:"></asp:Label>
                    <asp:TextBox ID="txtID" runat="server" Visible="False" CssClass="text"></asp:TextBox>
                </div>
            </div>
            <div style="padding: 0px 0px 0px 30px">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="BulletList"
                HeaderText="You must enter a value in the following fields:" ForeColor="red" EnableClientScript="True"/>
            </div>
            <!--end IDUpdateBy va CreateDate-->
            <div class="mainquoc">
                
                <div class="quoclable">
                    <asp:Label ID="lbEntryName" runat="server" Text="<%$ Resources:AllSite,lbEntryName0_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtEntryName" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ErrorMessage=" EntryName is required" Text="(*)" 
                    ControlToValidate="txtEntryName" ForeColor="red"></asp:RequiredFieldValidator>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbViewed" runat="server" Text="<%$ Resources:AllSite,lbViewedEntry_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtViewed"  runat="server" CssClass="text"></asp:TextBox>
                </div>
            </div>

            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbEntContent" runat="server" Text="<%$ Resources:AllSite,lbEntContentEntry_userResource1 %>"></asp:Label>
                </div>
                <div style="width:865; float: left;">
                    <asp:TextBox ID="txtEntContent" TextMode="multiline" Height="200px" runat="server" CssClass="text"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ErrorMessage="EntContent is required" Text="(*)" 
                    ControlToValidate="txtEntContent" ForeColor="red"></asp:RequiredFieldValidator>
                </div>
                
            </div>

            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbPrice" Text="<%$ Resources:AllSite,lbPriceEntEntry_userResource1 %>" runat="server"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtPrice" runat="server" CssClass="text"></asp:TextBox>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbPriceDesc" Text="<%$ Resources:AllSite,lbPriceDescEntEntry_userResource1 %>" runat="server"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtPriceDesc" runat="server" CssClass="text" MaxLength="20"></asp:TextBox>
                </div>
            </div>

            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbIDPriceType" runat="server" Text="<%$ Resources:AllSite,lbIDPriceTypeEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDPriceType" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbNameToContact" runat="server" Text="<%$ Resources:AllSite,lbNameToContactEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtNameToContact" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="NameToContact is required" Text="(*)" 
                    ControlToValidate="txtNameToContact" ForeColor="red"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbPhoneToContact" runat="server" Text="<%$ Resources:AllSite,lbPhoneToContactEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtPhoneToContact" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ErrorMessage="PhoneToContact is required" Text="(*)" 
                    ControlToValidate="txtPhoneToContact" ForeColor="red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Text="(*)" 
                    ErrorMessage="PhoneToContact is a number" ForeColor="red"
                    ControlToValidate="txtPhoneToContact" ValidationExpression="[0-9]+"></asp:RegularExpressionValidator>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbAddressToContact" runat="server" Text="<%$ Resources:AllSite,lbAddressToContactEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtAddressToContact" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ErrorMessage="AddressToContact is required" Text="(*)" 
                    ControlToValidate="txtAddressToContact" ForeColor="red"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbEmailToContact" runat="server" Text="<%$ Resources:AllSite,lbEmailToContactEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtEmailToContact" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ErrorMessage="EmailToContact is required" Text="(*)" 
                    ControlToValidate="txtEmailToContact" ForeColor="red"></asp:RequiredFieldValidator>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbIDUrgent" runat="server" Text="<%$ Resources:AllSite,lbIDUrgentEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDUrgent" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbUrgenFromDate" runat="server" Text="<%$ Resources:AllSite,lbUrgenFromDateEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtUrgenFromDate" runat="server" CssClass="date"></asp:TextBox>
                    <asp:CalendarExtender ID="CalUrgenFromDate" runat="server" Format="dd/MM/yyyy" TargetControlID="txtUrgenFromDate"
                        PopupButtonID="ibtCal" >
                    </asp:CalendarExtender>
                    <asp:ImageButton ID="ibtCal" runat="server" Height="18px" ImageUrl="~/Images/Icon/cal.png"
                        Width="18px" OnClick="ibtCal_Click" ImageAlign="AbsMiddle" />
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbUrgentToDate" runat="server" Text="<%$ Resources:AllSite,lbUrgentToDateEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtUrgentToDate" runat="server" CssClass="date"></asp:TextBox>
                    <asp:CalendarExtender ID="CalUrgentToDate" runat="server" Format="dd/MM/yyyy" TargetControlID="txtUrgentToDate"
                        PopupButtonID="ibtUrgentToDate">
                    </asp:CalendarExtender>
                    <asp:ImageButton ID="ibtUrgentToDate" runat="server" Height="18px" ImageUrl="~/Images/Icon/cal.png"
                        Width="18px"  ImageAlign="AbsMiddle" onclick="ibtUrgentToDate_Click" />
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbUrgentStatus" runat="server" Text="<%$ Resources:AllSite,lbUrgentStatusEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtUrgentStatus" runat="server" CssClass="text"></asp:TextBox>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbIDCategoryLv" runat="server" Text="<%$ Resources:AllSite,lbIDCategoryLvEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDCategoryLv" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbIDEntType" runat="server" Text="<%$ Resources:AllSite,lbIDEntTypeEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDEntType" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbIDSaleType" runat="server" Text="<%$ Resources:AllSite,lbIDSaleTypeEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDSaleType" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbIDUserApprove" runat="server" Text="<%$ Resources:AllSite,lbIDUserApproveEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDUserApprove" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbIDCity" runat="server" Text="<%$ Resources:AllSite,lbIDCityEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropIDCity" CssClass="dropdown" runat="server">
                    </asp:DropDownList>
                </div>
            </div>
            <div class="mainquoc">
                <div class="quoclable">
                    <asp:Label ID="lbActive" runat="server" Text="<%$ Resources:AllSite,lbActiveEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:DropDownList ID="dropActive" CssClass="dropdown" runat="server">
                        <asp:ListItem Value="Y">Y</asp:ListItem>
                        <asp:ListItem Value="N">N</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="quoclable">
                    <asp:Label ID="lbKeywords" runat="server" Text="<%$ Resources:AllSite,lbKeywordsEnt_userResource1 %>"></asp:Label>
                </div>
                <div class="quocinput_detail">
                    <asp:TextBox ID="txtKeywords" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                </div>
            </div>
        </div>
        <div style="width: 100%">
            <div style="width: 20%; float: left">
                <asp:Image runat="server" ID="img0" Width="100%" Height="150"/>
                <asp:CheckBox runat="server" ID="chkImg0" Text="Accept Img 1"/>
            </div>
            <div style="width: 20%; float: left">
                <asp:Image runat="server" ID="img1" Width="100%" Height="150"/>
                <asp:CheckBox runat="server" ID="chkImg1" Text="Accept Img 2"/>
            </div>
            <div style="width: 20%; float: left">
                <asp:Image runat="server" ID="img2" Width="100%" Height="150"/>
                <asp:CheckBox runat="server" ID="chkImg2" Text="Accept Img 3"/>
            </div>
            <div style="width: 20%; float: left">
                <asp:Image runat="server" ID="img3" Width="100%" Height="150"/>
                <asp:CheckBox runat="server" ID="chkImg3" Text="Accept Img 4"/>
            </div>
        </div>
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,UpdateEnt_Resource1 %>" CssClass="uupdate" ID="btnOk" OnClick="btnOk_Click">Update</asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,BackEnt_Resource1 %>" CssClass="uback" ID="btnBack" 
                        OnClick="btnBack_Click" CausesValidation="False">Back</asp:LinkButton>
                </li>
            </ul>
        </div>
    </asp:Panel>
    </ContentTemplate>
    <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click"/>
            <asp:AsyncPostBackTrigger ControlID="btnBack" EventName="Click"/>
            <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click"/>
            <asp:AsyncPostBackTrigger ControlID="btnOk" EventName="Click"/>
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress" runat="server">
        <ProgressTemplate>
            <div id="progress">
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Admin/Images/loading6.gif"/>
                </div>
            <div id="blur" />
        </ProgressTemplate>
    </asp:UpdateProgress>

</asp:Content>
